'use strict';

let Koa = require('koa');
let bodyparser = require('koa-bodyparser');
let templating = require('./templating');
let controller = require('./controllers');
let staticRes = require('koa-static');

let app = new Koa();

app.use(bodyparser());
app.use(templating);
app.use(controller());
app.use(staticRes(__dirname+'/statics'));

app.use(async (ctx,next) =>{
    ctx.render('hello.html');
});

let port = 5000;
app.use(port);

console.log(`http://127.0.0.1:${port}`);